package com.qfedu.aunt.commons.config;

import com.qfedu.aunt.commons.interceptor.GlobleInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringBootConfiguration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;

/**
 * @author xiaobobo
 * @title: WebMvcConfig
 * @projectName aunt_commons_2209
 * @description: TODO
 * @date 2022/11/4  14:25
 */
@SpringBootConfiguration
public class WebMvcConfig extends WebMvcConfigurationSupport {

    @Autowired
    private GlobleInterceptor globleInterceptor;

    @Override
    protected void addInterceptors(InterceptorRegistry registry) {
        //在这里添加我们的拦截器
        registry.addInterceptor(globleInterceptor);
        super.addInterceptors(registry);
    }
}
